package com.ruochen.recipe.ui.activity.login;

import android.os.Bundle;
import android.view.View;

import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.SizeUtils;
import com.lxj.xpopup.XPopup;
import com.ruochen.common.listener.NoDoubleClickListener;
import com.ruochen.recipe.R;
import com.ruochen.recipe.customer.ImproveInformationPopup;
import com.ruochen.recipe.databinding.ActivityLoginBinding;
import com.ruochen.recipe.mvp.login.LoginCovenant;
import com.ruochen.recipe.mvp.login.LoginPresenter;
import com.ruochen.common.base.BaseMvpActivity;
import com.ruochen.recipe.utils.SoftKeyboardFixerForFullscreen;

/**
 * @Description 登录
 * @Auth RuoChen
 * @Date 10/03/2021, 21:53
 **/
public class LoginActivity extends BaseMvpActivity<ActivityLoginBinding, LoginPresenter> implements LoginCovenant.MvpView {

    @Override
    protected void initView(Bundle var1) {
        SoftKeyboardFixerForFullscreen.assistActivity(this);

        viewBinding.rtvDoLogin.setOnClickListener(new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View view) {
                new XPopup.Builder(mContext)
                        .dismissOnTouchOutside(false)
                        .dismissOnTouchOutside(false)
                        .enableDrag(false)
                        .autoOpenSoftInput(false)
                        .autoFocusEditText(false)
                        .moveUpToKeyboard(false)
                        .popupWidth(SizeUtils.dp2px(800))
                        .popupHeight(SizeUtils.dp2px(600))
                        .isDestroyOnDismiss(true)
                        .asCustom(new ImproveInformationPopup(mContext))
                        .show();
            }
        });

    }

    @Override
    protected LoginPresenter createPresenter() {
        return new LoginPresenter(this);
    }


}
